#include "threshold_evaluator.h"

double precision::get_value(int tp, int tn, int fp, int fn) {
	int denominator = tp + fp;
	if(denominator == 0) {
		return 0;
	} else {
		return tp / (double) denominator;
	}
}

double recall::get_value(int tp, int tn, int fp, int fn) {
	int denominator = tp + fn;
	if(denominator == 0) {
		return 0;
	} else {
		return tp / (double) denominator;
	}
}

double fpr::get_value(int tp, int tn, int fp, int fn) {
	int denominator = tn + fp;
	if(denominator == 0) {
		return 0;
	} else {
		return fp / (double) denominator;
	}
}

double fnr::get_value(int tp, int tn, int fp, int fn) {
	int denominator = tp + fn;
	if(denominator == 0) {
		return 0;
	} else {
		return fn / (double) denominator;
	}
}
